package dao;

import cn.hutool.core.date.DateTime;
import entity.User;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import utils.DataSourceUtils;

import java.sql.SQLException;
import java.util.Date;

public class RegisterDao {
    public User addUser(String username , String name, String password , String birth, String phone,String email) throws SQLException {
        String sql = "INSERT INTO kfm_user(username,name,password,birth,create_time,phone,email) values (?,?,?,?,NOW(),?,?) ";
        QueryRunner queryRunner = new QueryRunner();
        return queryRunner.insert(DataSourceUtils.getConnection(), sql, new BeanHandler<>(User.class), username, name,password,birth,phone,email);
    }
}
